package com.pacy.pacybaseproject.viewmodels;

import android.app.Application;

import com.pacy.pacybaseproject.activitys.AuthMethodActivity;
import com.pacy.pacybaseproject.activitys.BusMapActivity;
import com.pacy.pacybaseproject.activitys.RoutingActivity;
import com.pacy.pacybaseproject.adapters.TravelStationAdapter;
import com.pacy.pacybaseproject.utils.Constants;

import io.reactivex.annotations.NonNull;
import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

/**
 * @author PACY
 * @date 2023/12/20
 * description:
 */
public class OneCodeViewModel extends BaseViewModel {
    public TravelStationAdapter mAdapter;
    public OneCodeViewModel(@NonNull Application application) {
        super(application);
    }
    @Override
    protected void init() {
        super.init();
        initAdapter();
    }

    public void initAdapter(){
        mAdapter=new TravelStationAdapter();
        mAdapter.setNewInstance(Constants.getTestData(5));
    }

    /**
     * 去公交地图
     */
    public BindingCommand toBusMapPage=new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            startActivity(BusMapActivity.class);
        }
    });

    /**
     * 去开通二维码
     */
    public BindingCommand toAuthPage=new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            startActivity(AuthMethodActivity.class);
        }
    });

    /**
     * 路线规划
     */
    public BindingCommand toRoutingPage=new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            startActivity(RoutingActivity.class);
        }
    });
}
